import pandas as pd
from fuzzywuzzy import fuzz


dfz = pd.read_excel(rf'')
dfk = pd.read_excel(rf'')

z = []
p = []
sorearr=[]


print(z)
for i in dfk.index:
    sorei = 0
    mybe = ''
    for j in dfz.index:
        sorej = fuzz.ratio(dfk['x'].at[i], dfz['x'].at[j])
        if sorej > sorei:
            mybe = dfz['x'].at[j]
            sorei = sorej


    z.append(dfk["x"].at[i])
    p.append(mybe)
    sorearr.append(sorei)


mydata = dict()
mydata['z'] = z
mydata['p'] = p
mydata['sore'] = sorearr
df1 = pd.DataFrame(mydata)
df1.to_excel(rf'D:\Desktop\mynewlearn\my3.xlsx')




